﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace WebNavigationApi.Migrations
{
    public partial class InitialCreate : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "WN_BOOKMARK",
                columns: table => new
                {
                    ID = table.Column<string>(type: "TEXT", nullable: false),
                    ICON = table.Column<string>(type: "TEXT", nullable: true),
                    NAME = table.Column<string>(type: "TEXT", nullable: true),
                    TYPE = table.Column<string>(type: "TEXT", nullable: true),
                    URL = table.Column<string>(type: "TEXT", nullable: true),
                    REMARK = table.Column<string>(type: "TEXT", nullable: true),
                    USER_ID = table.Column<string>(type: "TEXT", nullable: true),
                    CREATETIME = table.Column<DateTime>(type: "TEXT", nullable: false),
                    UPDATETIME = table.Column<DateTime>(type: "TEXT", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_WN_BOOKMARK", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "WN_BOOKMARK_TYPE",
                columns: table => new
                {
                    ID = table.Column<string>(type: "TEXT", nullable: false),
                    NAME = table.Column<string>(type: "TEXT", nullable: true),
                    USER_ID = table.Column<string>(type: "TEXT", nullable: true),
                    CREATETIME = table.Column<DateTime>(type: "TEXT", nullable: false),
                    UPDATETIME = table.Column<DateTime>(type: "TEXT", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_WN_BOOKMARK_TYPE", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "WN_USER",
                columns: table => new
                {
                    ID = table.Column<string>(type: "TEXT", nullable: false),
                    IMG = table.Column<string>(type: "TEXT", nullable: true),
                    USERNAME = table.Column<string>(type: "TEXT", nullable: true),
                    PASSWORD = table.Column<string>(type: "TEXT", nullable: true),
                    REMARK = table.Column<string>(type: "TEXT", nullable: true),
                    CREATETIME = table.Column<DateTime>(type: "TEXT", nullable: false),
                    UPDATETIME = table.Column<DateTime>(type: "TEXT", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_WN_USER", x => x.ID);
                });

            migrationBuilder.CreateTable(
                name: "WN_VISIT",
                columns: table => new
                {
                    ID = table.Column<string>(type: "TEXT", nullable: false),
                    BOOKMARK_ID = table.Column<string>(type: "TEXT", nullable: true),
                    USER_ID = table.Column<string>(type: "TEXT", nullable: true),
                    CREATETIME = table.Column<DateTime>(type: "TEXT", nullable: false),
                    UPDATETIME = table.Column<DateTime>(type: "TEXT", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_WN_VISIT", x => x.ID);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "WN_BOOKMARK");

            migrationBuilder.DropTable(
                name: "WN_BOOKMARK_TYPE");

            migrationBuilder.DropTable(
                name: "WN_USER");

            migrationBuilder.DropTable(
                name: "WN_VISIT");
        }
    }
}
